package Day014_Lambda表达式_Stream流.ZuoYe.Test4;

import java.util.stream.Stream;

/**
 * @author zhangyan
 * @date 2020/5/5 18:33
 */
public class Test3 {
    public static void main(String[] args) {
        //获取Stream流
        Stream<Integer> stream = Stream.of(1, -2, -3, 4, -5);
        //利用map方法 返回元素的绝对值
        stream.map((Integer i) -> {
            return Math.abs(i);
        }).forEach((Integer i) -> {
            System.out.println(i);
        });
    }
}